package com.lagou.controller;

import com.lagou.domain.Tarticle;
import com.lagou.service.TarticleServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * Created by shixi  on 2020/10/15
 */
@Controller
public class ApiController {
    @Autowired
    private TarticleServiceImpl tarticleService;

    @RequestMapping("/page")
    @ResponseBody
    public Page<Tarticle> pages(@RequestParam Integer pageNum, @RequestParam Integer pageSize){
        return tarticleService.pages(pageNum, pageSize);
    }

    @RequestMapping("/test")
    @ResponseBody
    public String pages(){
        return "test";
    }
}
